chore: Replacemypy with pyrefly type checker (do not merge)#678
Draft
Aaron ("AJ") Steers (aaronsteers) wants to merge 7 commits intomainfrom
Draft
chore: Replacemypy with pyrefly type checker (do not merge)#678Aaron ("AJ") Steers (aaronsteers) wants to merge 7 commits intomainfrom
mypy with pyrefly type checker (do not merge)#678Aaron ("AJ") Steers (aaronsteers) wants to merge 7 commits intomainfrom
Conversation
- Replace mypy dependency with pyrefly ^0.26.0 - Update CI workflow from mypy-check to pyrefly-check - Update type-check Poe task to use pyrefly - Add pyrefly configuration with python_version and project_excludes - Use pyrefly --suppress-errors to auto-add noqa comments for legacy code - Test integration shows 0 errors with 530 ignored violations Co-Authored-By: AJ Steers <aj@airbyte.io>
Contributor
|
Original prompt from AJ Steers: |
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. Testing This CDK VersionYou can test this version of the CDK using the following: # Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@devin/1753838067-test-pyrefly-type-checker#egg=airbyte-python-cdk[dev]' --help
# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch devin/1753838067-test-pyrefly-type-checkerHelpful ResourcesPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
- Fix pyrefly suppression comments displaced by ruff formatting - Move suppression comments to correct lines for type errors - Apply ruff format fixes to maintain code style consistency - Verify pyrefly still works: 0 errors (528 ignored) Co-Authored-By: AJ Steers <aj@airbyte.io>
…ment - Move pyrefly suppression comment to correct line after ruff formatting - Verify both ruff format --check and pyrefly type-check pass locally - Final fix for Ruff Format Check CI failure Co-Authored-By: AJ Steers <aj@airbyte.io>
mpyp with pyrefly type checker (do not merge)
mpyp with pyrefly type checker (do not merge)mypy with pyrefly type checker (do not merge)
…in permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
- Run pyrefly init to migrate mypy.ini to pyrefly.toml - Auto-suppress 2 errors in bin/ and docs/ files - Remove redundant [tool.pyrefly] section from pyproject.toml - Remove obsolete mypy.ini file - Pyrefly check now shows 0 errors (526 ignored) Co-Authored-By: AJ Steers <aj@airbyte.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: Replace MyPy with pyrefly type checker (do not merge)
Summary
This PR replaces MyPy with Meta's
pyreflytype checker as a test to evaluate pyrefly as a potential MyPy alternative for the airbyte-python-cdk repository. The integration uses pyrefly's--suppress-errorsauto-noqa feature to automatically add suppression comments for existing type violations, allowing us to focus on evaluating the tool's performance and usability rather than fixing legacy type issues.Key Changes:
mypydependency withpyrefly ^0.26.0mypy-checktopyrefly-checktype-checkPoe task to usepyrefly check airbyte_cdkbin,docs, andunit_testsdirectoriesResults: Local testing shows
0 errors (530 ignored)- pyrefly successfully runs with auto-noqa suppression.Review & Testing Checklist for Human
pyrefly-checkjob completes successfully and doesn't timeout# pyrefly: ignorecomments to ensure they're reasonable and not masking critical type safety issuespoetry run poe type-checklocally to confirm the workflow works for developersDiagram
%%{ init : { "theme" : "default" }}%% graph TD pyproject["pyproject.toml<br/>Dependency & Config"]:::major-edit workflow[".github/workflows/<br/>python_lint.yml<br/>CI Pipeline"]:::major-edit poetry_lock["poetry.lock<br/>Lock File"]:::minor-edit airbyte_cdk["airbyte_cdk/<br/>84 Python Files<br/>with Suppressions"]:::minor-edit pyproject -->|"defines pyrefly ^0.26.0"| poetry_lock pyproject -->|"configures tool.pyrefly"| workflow workflow -->|"runs pyrefly check"| airbyte_cdk pyproject -->|"poe type-check task"| airbyte_cdk subgraph Legend L1[Major Edit]:::major-edit L2[Minor Edit]:::minor-edit L3[Context/No Edit]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes
--suppress-errorsto focus on tool evaluation rather than fixing existing type issuesThe large number of auto-generated suppressions (530) indicates significant type inconsistencies in the legacy codebase that pyrefly detected. This provides valuable insight into the codebase's type safety status while allowing evaluation of pyrefly's capabilities.